package com.longxiao.para;

/**
 * 说明：分页搜索参数
 * author:wyyusong
 * Date:14-5-28
 * Time:下午2:11
 */
public class PageParam {
    protected final static int PAGE_SHOW_COUNT = 10;
    //第多少页
    protected int pageNum = 1;
    //每页多少条
    protected int pageSize = 20;
    //总条数
    protected int totalCount ;
    //targetType: navTab或dialog，用来标记是navTab上的分页还是dialog上的分页
    protected String targetType = "navTab";
    //数据库分页参数
    private String page;
    public static int getPageShowCount() {
        return PAGE_SHOW_COUNT;
    }

    public int getPageNum() {
        return pageNum;
    }

    public void setPageNum(int pageNum) {
        this.pageNum = pageNum;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
    }

    public String getNewsTypes() {
        return targetType;
    }

    public void setNewsTypes(String newsTypes) {
        this.targetType = newsTypes;
    }

    public int getNumPerPage() {
        return pageSize;
    }

    public void setNumPerPage(int pageSize) {
        this.pageSize = pageSize;
    }

    public String getPage() {
        //分页计算
        int pageStartNum = (pageNum - 1) * pageSize;
        return " limit " + String.valueOf(pageStartNum) + "," + String.valueOf(pageSize);
    }

}
